<template>
  <div>
    <div class="topDiv">
      <div>
        <p>订单ID</p>
        <span>{{form.goodsNo}}</span>
      </div>
      <div>
        <p>订单生成日期</p>
        <span>{{form.createDate}}</span>
      </div>
    </div>
    <p class="hint">拼团用户</p>
    <div class="list">
      <div
        class="listInfo"
        v-for="(item,index) in form.groupOrderCustomerList"
        :key="index"
      >
        <div class="left">
          <div class="img">
            <img :src="item.avatar" alt mode="scaleToFill">
          </div>
          <div class="info">
            <p>{{item.nickname}}</p>
            <span>{{item.phone}}</span>
          </div>
        </div>
        <div
          :class="item.state === '1' ? 'rightxj' : 'rightzs'"
        >{{item.state === '1' ? '虚拟' : '真实'}}</div>
      </div>
    </div>
  </div>
</template>

<script>
import { FIND_GROUP_ORDER_INFO } from '@/api'

export default {
  components: {},
  data () {
    return {
      groupOrderNo: '',
      form: {}
    }
  },
  onShow () {
    this.groupOrderNo = this.$root.$mp.query.groupOrderNo
    this._findGroupOrderInfo()
  },
  created () {},
  methods: {
    _findGroupOrderInfo () {
      const vm = this
      FIND_GROUP_ORDER_INFO(vm.groupOrderNo)
        .then(r => {
          if (r.data.code === '0') {
            let reg = /:/g
            let data = r.data.data
            data.groupOrderCustomerList.forEach(_ => {
              _.avatar = _.avatar.replace(reg, 's' + ':')
            })
            vm.form = data
          } else {
            vm.$toast(r.data.message)
          }
        })
        .catch(e => {
          console.info(e)
        })
    }
  }
}
</script>

<style lang="scss">
body {
  background: #edf0f5;
}
.topDiv {
  div {
    width: 100%;
    background: #fff;
    height: 40px;
    font-size: 14px;
    color: #000;
    font-weight: 500;
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    p {
      width: 110px;
      margin-left: 20px;
    }
  }
}
.hint {
  color: #6b8fdb;
  font-size: 14px;
  line-height: 14px;
  margin: 9px 0 15px 20px;
}
.list {
  .listInfo {
    width: 100%;
    height: 90px;
    display: flex;
    align-items: center;
    background: #fff;
    margin-bottom: 8px;
    .left {
      display: flex;
      justify-content: flex-start;
      .img {
        width: 90px;
        img {
          width: 50px;
          height: 50px;
          border-radius: 50px;
          margin: 0 20px;
        }
      }
      .info {
        width: 205px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        font-size: 14px;
        p {
          color: #000;
        }
        span {
          color: #a0a0a0;
        }
      }
    }
    .rightzs {
      width: 100px;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 14px;
      color: #6a8ad5;
    }
    .rightxj {
      width: 100px;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 14px;
      color: #b21f1f;
    }
  }
}
</style>

